const express = require('express')
const app = express()
app.set('secret', '123456789')
const port = 3000
    // 静态文件托管
app.use('/uploads', express.static(__dirname + '/uploads'))
app.use(require('cors')()) //跨域 中间间 
app.use(express.json()) //post 请求解析
require('./pilugins/db')(app)
require('./routes/admin')(app)
app.listen(port, () => console.log(`Example app listening on port ${port}! running on http://localhost:3000`))